<?php
$this->pageHeader = t('PAGE_TITLE', 'settings');
$this->pageTitle = t('PAGE_TITLE', 'settings');
$toolbar = new LGToolbar();
$toolbar->Button('btnSave', t('BTN_SAVE'));
$toolbar->Cancel('btnCancel', t('BTN_CANCEL'));
$this->pageToolbar = $toolbar->mergeToolbar();
$this->breadcrumbs = array('Global Settings');
?>

<?php
$form = $this->beginWidget('CActiveForm', array(
    'id' => 'setting-form',
    'enableClientValidation' => true,
        ));
?>

<script type='text/javascript'>
    $(document).ready(function(){
        $('#btnSave').click(function(){
            $('#setting-form').submit();
        });
    });
</script>

<table class="form" style="width: 100%">
    <tr>
        <td style="width: 48%; vertical-align: top">
            <fieldset>
                <legend>Site Settings</legend>
                <table class="form">
                    <tr>
                        <td class="label required"><?php echo $form->labelEx($model, 'site_name'); ?></td>
                        <td class="input">
                            <?php echo $form->textField($model, 'site_name', array('style' => 'width:210px')); ?>
                            <?php echo $form->error($model, 'site_name'); ?>
                        </td>
                    </tr>
                    <tr>
                        <td class="label"><?php echo $form->labelEx($model, 'site_offline'); ?></td>
                        <td class="radio-button">
                            <?php
                            echo $form->radioButtonList($model, 'site_offline', array(0 => 'No',
                                1 => 'Yes'), array('separator' => " "));
                            ?>
                            <?php echo $form->error($model, 'site_offline'); ?>
                        </td>
                    </tr>
                    <tr>
                        <td class="label"  style="vertical-align: top"><?php echo $form->labelEx($model, 'offline_message'); ?></td>
                        <td class="input" >
                            <?php echo $form->textArea($model, 'offline_message', array('style' => 'width:215px;height:80px')); ?>
                            <?php echo $form->error($model, 'offline_message'); ?>
                        </td>
                    </tr>
                    <tr>
                        <td class="label"><?php echo $form->labelEx($model, 'list_limit'); ?></td>
                        <td class="input" >
                            <?php
                            echo $form->dropDownList($model, 'list_limit', Html::listData($model->getListLimit(), 'code', 'value'));
                            ?>
                            <?php echo $form->error($model, 'list_limit'); ?>
                        </td>
                    </tr>
                    <tr>
                        <td class="label" ><?php echo $form->labelEx($model, 'language'); ?></td>
                        <td class="input" >
                            <?php
                            echo $form->dropDownList($model, 'language', Html::listData(Language::model()->findAll(), 'code', 'value'));
                            ?>
                            <?php echo $form->error($model, 'language'); ?>
                        </td>
                    </tr>
                </table>
            </fieldset>

            <fieldset>
                <legend>SEO Settings</legend>
                <table class="form">
                    <tr>
                        <td class="label"><?php echo $form->labelEx($model, 'url_rewriting'); ?></td>
                        <td class="radio-button">
                            <?php
                            echo $form->radioButtonList($model, 'url_rewriting', array(0 => 'No',
                                1 => 'Yes'), array('separator' => " "));
                            ?>
                            <?php echo $form->error($model, 'url_rewriting'); ?>
                        </td>
                    </tr>
                    <tr>
                        <td class="label"><?php echo $form->labelEx($model, 'suffix_to_url'); ?></td>
                        <td class="radio-button">
                            <?php
                            echo $form->radioButtonList($model, 'suffix_to_url', array(0 => 'No',
                                1 => 'Yes'), array('separator' => " "));
                            ?>
                            <?php echo $form->error($model, 'suffix_to_url'); ?>
                        </td>
                    </tr>
                    <tr>
                        <td class="label" style="width: 180px;"><?php echo $form->labelEx($model, 'include_site_name'); ?></td>
                        <td class="input" >
                            <?php
                            echo $form->dropDownList($model, 'include_site_name', Html::listData($model->getListInclude(), 'code', 'value'));
                            ?>
                            <?php echo $form->error($model, 'include_site_name'); ?>
                        </td>
                    </tr>
                </table>
            </fieldset>
        </td>
        <td >

        </td>
        <td style="width: 48%; vertical-align: top">
            <fieldset>
                <legend>Metadata Settings</legend>
                <table>
                    <tr>
                        <td class="label"  style="vertical-align: top"><?php echo $form->labelEx($model, 'meta_description'); ?></td>
                        <td class="input" >
                            <?php echo $form->textArea($model, 'meta_description', array('style' => 'width:215px;height:80px')); ?>
                            <?php echo $form->error($model, 'meta_description'); ?>
                        </td>
                    </tr>
                    <tr>
                        <td class="label" style="vertical-align: top"><?php echo $form->labelEx($model, 'meta_keywords'); ?></td>
                        <td class="input" >
                            <?php echo $form->textArea($model, 'meta_keywords', array('style' => 'width:215px;height:80px')); ?>
                            <?php echo $form->error($model, 'meta_keywords'); ?>
                        </td>
                    </tr>
                    <tr>
                        <td class="label required"><?php echo $form->labelEx($model, 'robots'); ?></td>
                        <td class="input">
                            <?php echo $form->dropDownList($model, 'robots', Category::model()->getRobots(), array('empty' => t('MSG_FIRST_ROBOTS', 'messages'))); ?>
                            <?php echo $form->error($model, 'robots'); ?>
                        </td>
                    </tr>
                    <tr>
                        <td class="label"><?php echo $form->labelEx($model, 'show_author_meta'); ?></td>
                        <td class="radio-button">
                            <?php
                            echo $form->radioButtonList($model, 'show_author_meta', array(0 => 'No',
                                1 => 'Yes'), array('separator' => " "));
                            ?>
                            <?php echo $form->error($model, 'show_author_meta'); ?>
                        </td>
                    </tr>
                </table>
            </fieldset>
        </td>
    </tr>
</table>
<div>Last update on <?php echo $model->update_date ?> by <?php echo $model->updated_by ?></div>
<?php $this->endWidget(); ?>